<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <%
        //获取项目的根路径
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    %>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>湖南省长沙市华子医院</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <!-- jquery -->
    <script type="text/javascript" src="<%=basePath%>static/jquery/jquery-1.12.4.js"></script>

    <link rel="stylesheet" href="<%=basePath%>static/doctor/css/base.css">
    <link rel="stylesheet" href="<%=basePath%>static/doctor/css/hospital.css">

    <!-- layui -->
    <link rel="stylesheet" href="<%=basePath%>static/layui-v2.6.5/layui/css/layui.css">
    <script type="text/javascript" src="<%=basePath%>static/layui-v2.6.5/layui/layui.js"></script>

</head>
<body>
<span id="doctorId" style="display: none;">${sessionScope.doctor.doctorId}</span>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo" style="color: white">湖南省长沙市华子医院</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="javascript:void(0)">医院详情</a></li>
            <li class="layui-nav-item"><a href="javascript:void(0)">医院简介</a></li>
            <li class="layui-nav-item"><a href="javascript:void(0)">医院地址</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:void(0);">
                    <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg"
                         class="layui-nav-img">
                    ${sessionScope.doctor.doctorName}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:void(0)">请假申请</a></dd>
                    <dd><a href="javascript:void(0)">个人信息</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="<%=basePath%>doctorLogin/toLogin">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">

                <c:if test="${sessionScope.doctor.position eq 'root'}">
                    <li class="layui-nav-item">
                        <a href="<%=basePath%>doctorg/index" target="content">主界面</a>
                    </li>

                    <li class="layui-nav-item">
                        <a href="<%=basePath%>Consume/index" target="content">前台</a>
                    </li>

                    <li class="layui-nav-item"><a href="<%=basePath%>drugY/drugPage" target="content">药房管理</a></li>
                    <li class="layui-nav-item"><a href="<%=basePath%>drug/index" target="content">库房管理</a></li>
                    <li class="layui-nav-item"><a href="<%=basePath%>FySelect" target="content">申请管理</a></li>
                    <li class="layui-nav-item"><a href="<%=basePath%>doctorY/doctorPage" target="content">人员管理</a></li>
                    <li class="layui-nav-item"><a href="<%=basePath%>total/statistical" target="content">账单统计</a></li>
                    <li class="layui-nav-item"><a href="javascript:void(0);">系统设置</a></li>

                </c:if>

                <c:if test="${sessionScope.doctor.position ne 'root'}">

                    <li class="layui-nav-item">
                        <a href="<%=basePath%>doctorg/index" target="content">主界面</a>
                    </li>

                    <li class="layui-nav-item layui-nav-itemed">
                        <a id="test" href="<%=basePath%>doctory/toDoctorImprove?doctorId=${sessionScope.doctor.doctorId}"
                           target="content">
                            医生诊断
                        </a>
                    </li>

                    <li class="layui-nav-item">
                        <a href="${pageContext.request.contextPath}/dept/ctPage" target="content">病人诊断记录</a>
                    </li>

                    <li class="layui-nav-item">

                        <a href="javascript:void(0);">科室管理</a>
<%--                            ${pageContext.request.contextPath}/dept/select--%>
                        <dl class="layui-nav-child">
                            <dd><a href="${pageContext.request.contextPath}/dept/radiology" target="content">放射科</a></dd>
                        </dl>
                        <dl class="layui-nav-child">
                            <dd><a href="" target="content">内科</a></dd>
                        </dl>
                        <dl class="layui-nav-child">
                            <dd><a href="" target="content">外科</a></dd>
                        </dl>
                        <dl class="layui-nav-child">
                            <dd><a href="" target="content">其它科室</a></dd>
                        </dl>
                    </li>

                    <li class="layui-nav-item"><a href="javascript:void(0);">系统设置</a></li>

                </c:if>

            </ul>

        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->

        <div style="padding: 15px;">

            <iframe src="<%=basePath%>doctorg/index" width="100%" height="740px"
                    style="border: none;background-color: white" name="content">
            </iframe>

        </div>

    </div>

</div>

<script>
    //JavaScript代码区域
    layui.use('element', function () {
        let element = layui.element;
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        let doctorId = $("#doctorId").text();
        if (doctorId != null) {
            $.ajax({
                url: "http://localhost:8081/doctorId",
                type: "post",
                data: {
                    doctorId: doctorId
                },
                dataType: "json",
                success: function (data) {
                    console.log(data)
                }
            })
        }
    })
</script>

</body>
</html>